package jdk8;

import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

/**
 * @author oldliu
 * @since 1.0
 */
public class Thread1 {
    public static void main(String[] args) {
//        Thread th=new Thread(new Runnable() {
//            @Override
//            public void run() {
//                for(int i=1;i<20;i++){
//                    System.out.println(" thread -"+i);
//                }
//            }
//        });
        Thread th=new Thread(()->{
            for(int i=1;i<20;i++){
                    System.out.println(" thread -"+i);
                }
        });
        th.start();

        //int f= (o1,o2)->Integer.compare(o1,o2);

        Comparator<Integer>comp=(o1,o2)->Integer.compare(o1,o2);
        int c = comp.compare(13, 51);
        System.out.println("c="+c);
        System.out.println(">>>>>>>>>>>>>");
        Predicate<Object> isNull= Objects::isNull;
        Predicate<Object> notNull= x->{return Objects.nonNull(x);};
        //isNull("222");
        System.out.println(isNull.test("sss"));
        System.out.println(notNull.test("sss"));
        String f="nihao";
        //Predicate<String> predicate = System.out::println;
        //runnable.ap
        Supplier<Map> m= HashMap::new;
        Map map = m.get();

    }
}
